import minRequest from '@/utils/request'

// 登录
export async function login(params) {
  return minRequest.post('/login', params)
}

// 注册
export async function register(params) {
  return minRequest.post('/register', params)
}

// 验证码
export async function captchaImage(params: any) {
  return minRequest.get('/captchaImage', params)
}

// 获取用户信息
export async function getInfo() {
  return minRequest.get('/getInfo')
}

// 修改用户信息
export async function profile(params) {
  return minRequest.put('/system/user/profile', params)
}

// 退出方法
export async function logout() {
  return minRequest.post('/logout')
}

// 修改密码
export async function updateUserPwd({ oldPassword, newPassword }) {
  return minRequest.put(`/system/user/profile/updatePwd?oldPassword=${oldPassword}&newPassword=${newPassword}`)
}
